<html>
<head>
<title>Test page for FBVLC</title>
</head>
    <script type="text/javascript">
        function plugin0()
        {
            return document.getElementById('plugin0');
        }
        plugin = plugin0;

        function addEvent(obj, name, func)
        {
            if (window.addEventListener) {
                obj.addEventListener(name, func, false);
            } else {
                obj.attachEvent("on"+name, func);
            }
        }

        function getByID(id)
        {
            return document.getElementById(id)
        }

        function getStateString()
        {
            var ret = "";

            var st = plugin().state;

            if ( plugin().libvlc_Opening == st ) {
                ret = "Opening";
            } else if ( plugin().libvlc_Buffering == st) {
                ret = "Buffering";
            } else if ( plugin().libvlc_Playing == st) {
                ret = "Playing";
            } else if ( plugin().libvlc_Paused == st) {
                ret = "Paused";
            } else if ( plugin().libvlc_Stopped == st) {
                ret = "Stopped";
            } else if ( plugin().libvlc_Ended == st) {
                ret = "Ended";
            } else if ( plugin().libvlc_Error == st) {
                ret = "Error";
            }

            return ret;
        }

        function updateState()
        {
            getByID('state').innerHTML = getStateString();
        }

        function load()
        {
            addEvent(plugin(), 'Play',                      updateState);
            addEvent(plugin(), 'Pause',                     updateState);
            addEvent(plugin(), 'Stop',                      updateState);
            addEvent(plugin(), 'MediaPlayerNothingSpecial', updateState);
            addEvent(plugin(), 'MediaPlayerOpening',        updateState);
            addEvent(plugin(), 'MediaPlayerBuffering',      updateState);
            addEvent(plugin(), 'MediaPlayerPlaying',        updateState);
            addEvent(plugin(), 'MediaPlayerPaused',         updateState);
            addEvent(plugin(), 'MediaPlayerStopped',        updateState);
            addEvent(plugin(), 'MediaPlayerEnded',          updateState);
            addEvent(plugin(), 'MediaPlayerError',          updateState);

            updateState();
        }
    </script>
<body onload="load()">

<object id="plugin0" type="application/x-fb-vlc" width="320" height="240">
<param name="windowless" value="true" />
<param name="autoplay" value="true" />
<param name="bgcolor" value="#999999" />
<param name="src" value="http://cam.admin.tomsk.ru/cgi-bin/cam3.pl" />
</object><br />

<div id="state" style="filter:alpha(opacity=70); -moz-opacity: 0.7; opacity: 0.7; text-align: center; background: #808080; display: block; position: relative; top: -25px; height: 25px; width: 320px;"></div>
MRL:<INPUT size="90" id="MRL" value="file:///">
<a href="#" onclick="javascript:plugin().play(document.getElementById('MRL').value)">play</a> <br />
<a href="#" onclick="javascript:plugin().togglePause()">togglePause</a> <br />
<a href="#" onclick="javascript:plugin().stop()">stop</a> <br />
<a href="#" onclick="javascript:plugin().toggleMute()">toggleMute</a> <br />
<a href="#" onclick="javascript:plugin().bgcolor = '#ffffff'">bgcolor = '#ffffff' (white)</a><span> or </span>
<a href="#" onclick="javascript:plugin().bgcolor = '#ff0000'">'#ff0000' (red)</a><span> or </span>
<a href="#" onclick="javascript:plugin().bgcolor = '#00ff00'">'#00ff00' (green)</a><span> or </span>
<a href="#" onclick="javascript:plugin().bgcolor = '#0000ff'">'#0000ff' (blue)</a><span> or </span>
<a href="#" onclick="javascript:plugin().bgcolor = '#000000'">'#000000' (black)</a>
</body>
</html>
